﻿@model HeaderLinksModel
@using Nop.Web.Models.Common;

        @Html.Widget("header_links_before")
        @if (Model.IsAuthenticated)
        {
            <div class="element place-right no-tablet-portrait no-phone">
                <a href="#" class="dropdown-toggle place-right">
                    <span class="icon-accessibility"></span>
                    <!--<span>@Model.CustomerEmailUsername</span>
                    <span>@T("Account.Navigation")</span>-->
                </a>
                <ul class="dropdown-menu place-left" data-role="dropdown">
                    @Html.Action("AdminHeaderLinks", "Common")
                    <li><a href="@Url.RouteUrl("CustomerInfo")">@T("Account.CustomerInfo")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerAddresses")">@T("Account.CustomerAddresses")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerOrders")">@T("Account.CustomerOrders")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerReturnRequests")">@T("Account.CustomerReturnRequests")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerDownloadableProducts")">@T("Account.DownloadableProducts")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerBackInStockSubscriptions")">@T("Account.BackInStockSubscriptions")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerRewardPoints")">@T("Account.RewardPoints")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerChangePassword")">@T("Account.ChangePassword")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerAvatar")">@T("Account.Avatar")</a></li>
                    <li><a href="@Url.RouteUrl("CustomerForumSubscriptions")">@T("Account.ForumSubscriptions")</a></li>
                    <li><a href="@Url.RouteUrl("Logout")" class="ico-logout">@T("Account.Logout")</a></li>
                </ul>
            </div>
        }
        else
        {
            @*<li><a href="@Url.RouteUrl("Register")" class="ico-register">@T("Account.Register")</a></li>
            <li><a href="@Url.RouteUrl("Login")" class="ico-login">@T("Account.Login")</a></li>*@
            <a title="login" class="element place-right no-tablet-portrait no-phone" href="@Url.RouteUrl("Login")"><span class="icon-enter"></span></a>
            <span class="element-divider place-right no-tablet-portrait no-phone"></span>
            <a title="register" class="element place-right no-tablet-portrait no-phone" href="@Url.RouteUrl("Register")"><span class="icon-clipboard-2"></span></a>
        }
        @*@if (Model.AllowPrivateMessages)
        {
            <li><a href="@Url.RouteUrl("PrivateMessages", new { tab = "" })" class="ico-inbox">@T("PrivateMessages.Inbox")</a>
                @Model.UnreadPrivateMessages</li>
            if (!string.IsNullOrEmpty(Model.AlertMessage))
            {
            <script type="text/javascript">
                $(document).ready(function () {
                    displayPopupNotification('@Html.Raw(HttpUtility.JavaScriptStringEncode(Model.AlertMessage))', 'success', false);
                });
            </script>
            }
        }*@
        @if (Model.ShoppingCartEnabled)
        {
            @*<li id="topcartlink">
                <a href="@Url.RouteUrl("ShoppingCart")" class="ico-cart">
                    <span class="cart-label">@T("ShoppingCart")</span>
                    <span class="cart-qty">@T("ShoppingCart.HeaderQuantity", Model.ShoppingCartItems)</span>
                </a>
            </li>*@
            <span class="element-divider place-right no-tablet-portrait no-phone"></span>
            <a id="topcartlink" class="element place-right no-tablet-portrait no-phone" href="@Url.RouteUrl("ShoppingCart")"><span class="icon-cart"></span></a>            
            @Html.Action("FlyoutShoppingCart", "ShoppingCart")
        }
        @*
        @if (Model.WishlistEnabled)
        {
            <li>
                <a href="@Url.RouteUrl("Wishlist")" class="ico-wishlist">
                    <span class="cart-label">@T("Wishlist")</span>
                    <span class="wishlist-qty">@T("Wishlist.HeaderQuantity", Model.WishlistItems)</span>
                </a>
            </li>
        }*@
        @Html.Widget("header_links_after")

    @if (Model.ShoppingCartEnabled)
    {
        <script type="text/javascript">
            $(document).ready(function () {
                $('.metro').on('mouseenter', '#topcartlink', function () {
                    $('#flyout-cart').addClass('active');
                });
                $('.metro').on('mouseleave', '#topcartlink', function () {
                    $('#flyout-cart').removeClass('active');
                });
                $('.metro').on('mouseenter', '#flyout-cart', function () {
                    $('#flyout-cart').addClass('active');
                });
                $('.metro').on('mouseleave', '#flyout-cart', function () {
                    $('#flyout-cart').removeClass('active');
                });
            });
        </script>
    }
